<include file="__THEME__/public_header" />

<div id="page-wrap">
  <div id="main-wrap">
    <div id="st-index-grid">
      <!--左边 -->
      <include file="__THEME__/public_left" />
      <div id="col8" class="content-bg clearfix boxShadow" style="width:auto">
        <div id="col4" class="main-left">
          <!--tab菜单-->
          <div id="aside" class="pad">
            <dl class="nav-left mt10 border-no">
              <dd class="current"><a href="{:U('public/Mention')}">@提到我的</a></dd>
              <dd><a href="{:U('public/Comment/index',array('app_name'=>t($_GET['app_name']),'type'=>'receive'))}">收到的评论</a></dd>
              <dd><a href="{:U('public/Comment/index',array('app_name'=>t($_GET['app_name']),'type'=>'send'))}">发出的评论</a></dd>
              <dd><a href="{:U('public/Message')}">我的私信</a></dd>
              <dd><a href="{:U('public/Message/notify')}">系统消息</a></dd>
            </dl>
          </div>
        </div>
        <div id="col7" class="main-right">
          <div class="extend minh person-set">
            <!--tab menu-->
            <div class="feed-nav">
              <div class="set-hd">
                <h3>@提到我的</h3>
              </div>
              <div class="mod-feed-tab">
                <ul class="inner-feed-nav">
                  <!--                  <li <eq name="_GET.t" value="">class="current"</eq> <eq name='_GET.t' value='feed'>class="current"</eq>><a href="{:U('public/Mention/index',array('t'=>'feed'))}">{:L('PUBLIC_WEIBO')}</a></li>-->
                  <li 
                  <eq name='_GET.t' value=''>class="current"</eq>
                  > <a href="{:U('public/Mention')}">{:L('PUBLIC_ALL_STREAM')}</a>
                  </li>
                  <volist name='tab' id='t'>
                    <php>if($tabHash[$key]){</php>
                    <li 
                    <eq name='_GET.t' value='$key'>class="current"</eq>
                    > <a href="{:U('public/Mention',array('t'=>$key))}">{$tabHash[$key]}</a>
                    </li>
                    <php>}</php>
                  </volist>
                </ul>
              </div>
            </div>
            <!--feed list-->
            <div class="feed_lists">
              <neq name='data' value=''>
                <volist name='data' id='vo'>
                  <dl class="feed_list clearfix" model-node="feed_list">
                    <dt class="face">
                      <php>if($vo['source_table'] == 'comment'):</php>
                      <a href="{$vo.comment_user_info.space_url}"> <img src="{$vo.comment_user_info.avatar_small}"  event-node="face_card" uid="{$vo.comment_user_info.uid}" width="50" height="50"></a>
                      <php>else:</php>
                      <a href="{$vo.source_user_info.space_url}"> <img src="{$vo.source_user_info.avatar_small}"  event-node="face_card" uid="{$vo.source_user_info.uid}" width="50" height="50"></a>
                      <php>endif;</php>
                    </dt>
                    <dd class="content">
                      <p class="hd">
                        <php>if($vo['source_table'] == 'comment'):</php>
                        <!-- 评论模板开始 -->
                        <php>if($vo['sourceInfo']['app'] != 'public'):</php>
                        <space uid="vo.comment_user_info.uid">{uname}</space>
                        ：<span class="f12 ico-bar-top">{$vo.source_type}</span>{$vo.source_content}
                      <dl class="comment">
                        <dt class="arrow bgcolor_arrow"><em class="arrline">◆</em><span class="downline">◆</span></dt>
                        <dd class="name">
                          <space uid="vo.sourceInfo.source_user_info.uid">@{uname}</space>
                        </dd>
                        <dd>{$vo.sourceInfo.source_body|format=true}</dd>
                      </dl>
                      <php>else:</php>
                      <space uid="vo.comment_user_info.uid">{uname}</space>
                      ：<span class="f12 ico-bar-top">{$vo.source_type}</span>
                      <php>if($vo['is_audit']){echo $vo[source_content];}else{echo '内容正在审核';}</php>
                      <dl class="comment">
                        <dt class="arrow bgcolor_arrow"><em class="arrline">◆</em><span class="downline">◆</span></dt>
                        <dd class="name">
                          <space uid="vo.sourceInfo.source_user_info.uid">@{uname}</space>
                        </dd>
                        <dd>
                          <php>if($vo['sourceInfo']['is_audit']){ echo format($vo[sourceInfo][source_body], true);}else{echo '内容正在审核';}</php>
                        </dd>
                        <p class="info"> <span class="right"> <a href="{:U('public/Profile/feed',array('uid'=>$vo['sourceInfo']['uid'],'feed_id'=>$vo['sourceInfo']['feed_id']))}">原文转发
                          <neq name="vo.sourceInfo.repost_count" value="0">({$vo.sourceInfo.repost_count})</neq>
                          </a><i class="vline">|</i> <a href="{:U('public/Profile/feed',array('uid'=>$vo['sourceInfo']['uid'],'feed_id'=>$vo['sourceInfo']['feed_id']))}">原文评论
                          <neq name="vo.sourceInfo.comment_count" value="0">({$vo.sourceInfo.comment_count})</neq>
                          </a> </span> <span><a href="{:U('public/Profile/feed',array('uid'=>$vo['sourceInfo']['uid'],'feed_id'=>$vo['sourceInfo']['feed_id']))}" date="{$vo.sourceInfo.publish_time}" class="date">{$vo.sourceInfo.publish_time|friendlyDate}</a><span>来自网站</span></span> </p>
                      </dl>
                      <php>endif;</php>
                      <!-- 评论模板结束 -->
                      <php>else:</php>
                      <space uid="vo.uid">{uname}</space>
                      ：<span class="f12 ico-bar-top">{$vo.source_type}</span>
                      <php>if($vo['is_audit']){ echo format($vo[source_body],ture);}else{echo '内容正在审核';}</php>
                      <php>endif;</php>
                      </p>
                      <p class="info">
                        <php>if($vo['is_audit']){</php>
                        <span class="right">
	<php>if(CheckPermission('vtask_admin','vtask_recommend')):</php>
	<em class="hover">
	   <a href="javascript:void(0);" onclick="addToVtask({$vo.feed_id});">添加到事务</a>
	   <i class="vline">|</i>	
	   </em>
	<php>endif;</php>
                        <php>if($vo['source_table'] == 'feed'):</php>
                        {:W('Digg', array('feed_id'=>$vo['feed_id'], 'digg_count'=>$vo['digg_count'], 'diggArr'=>$diggArr))}
                        <i class="vline">|</i>
                        <php>endif;</php>
                        <a href="{$vo.source_url}" >{:L('PUBLIC_VIEW')}</a>
                        <php>if(in_array('repost',$weibo_premission) || $vo['widget_stype'] !='feed'):</php>
                        <php>if($vo['source_table'] == 'comment'):</php>
                        <php>if(in_array('comment',$weibo_premission) && CheckPermission('core_normal','feed_comment') ):</php>
                        <i class="vline">|</i> <a href="javascript:void(0);" onclick="ui.reply({$vo['source_id']})">{:L('PUBLIC_STREAM_REPLY')}</a>
                        <php>endif;</php>
                        <php>else:</php>
                        <php>if(in_array('repost',$weibo_premission) && CheckPermission('core_normal','feed_share')):</php>
                        <i class="vline">|</i> {:W('Share',array('sid'=>$vo['widget_share_sid'],'stable'=>$vo['widget_stype'],'current_id'=>$vo['widget_curid'],'current_table'=>$vo['widget_curtable'],'nums'=>$vo['repost_count'],'appname'=>$vo['app'],'feed_type'=>$vo['type'],'is_repost'=>$vo['is_repost']))}
                        <php>endif;</php>
                        <php>endif;</php>
                        <php>endif;</php>
                        <php>if($vo['source_table'] != 'comment'):</php>
                        <i class="vline">|</i> {:W('Collection',array('type'=>'following','sid'=>$vo['widget_sid'],'stable'=>'feed','sapp'=>$vo['app']))}
                        <php>if(in_array('comment',$weibo_premission)):</php>
                        <php> $cancomment = intval(CheckPermission('core_normal','feed_comment')); </php>
                        <i class="vline">|</i> <a event-node="comment" href="javascript:void(0)" event-args="row_id={$vo['widget_sid']}&app_uid={$vo['widget_suid']}&to_comment_id=0&to_uid=0&table={$vo['widget_stype']}&app_row_id={$vo['widget_sid']}&app_row_table={$vo['app_row_table']}&cancomment={$cancomment}&app_name={$vo.app}">{:L('PUBLIC_STREAM_COMMENT')}
                        <neq name='vo.comment_count' value='0'> ({$vo.comment_count}) </neq>
                        </a>
                        <php>endif;</php>
                        <php>endif;</php>
                        </span> <span><a class="date" date="{$vo.ctime}" href="{$vo.source_url}">{$vo.ctime|friendlyDate}</a><span>来自网站</span></span>
                        <php>if($vo['uid'] != $mid && $vo['source_table'] != 'comment'):</php>
                        <php>if(CheckPermission('core_normal','feed_report')):</php>
                        <em class="hover"> <a href="javascript:void(0)" event-node="denounce" event-args="aid={$vo['widget_sid']}&type={$vo['widget_stype']}&uid={$vo['widget_suid']}">{:L('PUBLIC_STREAM_REPORT')}</a> </em>
                        <php>endif;</php>
                        <php>endif;</php>
                        <php>if($i <= $unread_atme_count):</php>
                        <img src="__THEME__/image/icon_new.gif" class="icon-new"/>
                        <php>endif;</php>
                        <php>}</php>
                      </p>
                      <div model-node="comment_detail" class="repeat clearfix" style="display:none;"></div>
                    </dd>
                  </dl>
                </volist>
                <else />
                <div class="note">{:L('PUBLIC_NO_MENTIONS')}</div>
              </neq>
              <div id='page' class='page'>{$html}</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript" src="__THEME__/js/module.weibo.js"></script>
<script type="text/javascript">
/**
 * 时间更新效果
 * return void
 */
core.loadFile(THEME_URL+'/js/core.weibo.js', function () {
  var wTime = parseInt("<?php echo time(); ?>");
  var updateTime = function () {
    $('.date').each(function (i, n) {
      var date = $(this).attr('date');
      if (typeof date !== 'undefined') {
        $(this).html(core.weibo.friendlyDate(date, wTime));
      }
    });
  };
  updateTime();
  setInterval(function () {
    wTime += 10;
    updateTime();
  }, 10000);
});

  //旋转图片
function revolving (type, id) {
  var img = $("#image_index_"+id);
  img.rotate(type);
}


$.fn.rotate = function(p){

  var img = $(this)[0],
    n = img.getAttribute('step');
  // 保存图片大小数据
  if (!this.data('width') && !$(this).data('height')) {
    this.data('width', img.width);
    this.data('height', img.height);
  };
  this.data('maxWidth',img.getAttribute('maxWidth'))

  if(n == null) n = 0;
  if(p == 'left'){
    (n == 0)? n = 3 : n--;
  }else if(p == 'right'){
    (n == 3) ? n = 0 : n++;
  };
  img.setAttribute('step', n);

  // IE浏览器使用滤镜旋转
  if(document.all) {
    if(this.data('height')>this.data('maxWidth') && (n==1 || n==3) ){
      if(!this.data('zoomheight')){
        this.data('zoomwidth',this.data('maxWidth'));
        this.data('zoomheight',(this.data('maxWidth')/this.data('height'))*this.data('width'));
      }
      img.height = this.data('zoomwidth');
      img.width  = this.data('zoomheight');
      
    }else{
      img.height = this.data('height');
      img.width  = this.data('width');
    }
    
    img.style.filter = 'progid:DXImageTransform.Microsoft.BasicImage(rotation='+ n +')';
    // IE8高度设置
    if ($.browser.version == 8) {
      switch(n){
        case 0:
          this.parent().height('');
          //this.height(this.data('height'));
          break;
        case 1:
          this.parent().height(this.data('width') + 10);
          //this.height(this.data('width'));
          break;
        case 2:
          this.parent().height('');
          //this.height(this.data('height'));
          break;
        case 3:
          this.parent().height(this.data('width') + 10);
          //this.height(this.data('width'));
          break;
      };
    };
  // 对现代浏览器写入HTML5的元素进行旋转： canvas
  }else{
    var c = this.next('canvas')[0];
    if(this.next('canvas').length == 0){
      this.css({'visibility': 'hidden', 'position': 'absolute'});
      c = document.createElement('canvas');
      c.setAttribute('class', 'maxImg canvas');
      img.parentNode.appendChild(c);
    }
    var canvasContext = c.getContext('2d');
    switch(n) {
      default :
      case 0 :
        img.setAttribute('height',this.data('height'));
        img.setAttribute('width',this.data('width'));
        c.setAttribute('width', img.width);
        c.setAttribute('height', img.height);
        canvasContext.rotate(0 * Math.PI / 180);
        canvasContext.drawImage(img, 0, 0);
        break;
      case 1 :
        if(img.height>this.data('maxWidth') ){
          h = this.data('maxWidth');
          w = (this.data('maxWidth')/img.height)*img.width;
        }else{
          h = this.data('height');
          w = this.data('width');
        }
        c.setAttribute('width', h);
        c.setAttribute('height', w);
        canvasContext.rotate(90 * Math.PI / 180);
        canvasContext.drawImage(img, 0, -h, w ,h );
        break;
      case 2 :
        img.setAttribute('height',this.data('height'));
        img.setAttribute('width',this.data('width'));
        c.setAttribute('width', img.width);
        c.setAttribute('height', img.height);
        canvasContext.rotate(180 * Math.PI / 180);
        canvasContext.drawImage(img, -img.width, -img.height);
        break;
      case 3 :
        if(img.height>this.data('maxWidth') ){
          h = this.data('maxWidth');
          w = (this.data('maxWidth')/img.height)*img.width;
        }else{
          h = this.data('height');
          w = this.data('width');
        }
        c.setAttribute('width', h);
        c.setAttribute('height', w);
        canvasContext.rotate(270 * Math.PI / 180);
        canvasContext.drawImage(img, -w, 0,w,h);
        break;
    };
  };
};
</script>

<include file="__THEME__/public_footer_g" />